
<!DOCTYPE HTML>
<html lang="" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>mysql 多版本控制 · GitBook</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        
        
        
    
    <link rel="stylesheet" href="gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="mysqlIndex.html" />
    
    
    <link rel="prev" href="level.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="Type to search" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="./">
            
                <a href="./">
            
                    
                    概述
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="mysqlTx.html">
            
                <a href="mysqlTx.html">
            
                    
                    mysql innoDB事务级别
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1" data-path="level.html">
            
                <a href="level.html">
            
                    
                    mysql 事务级别
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.2.2" data-path="mvvc.html">
            
                <a href="mvvc.html">
            
                    
                    mysql 多版本控制
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="mysqlIndex.html">
            
                <a href="mysqlIndex.html">
            
                    
                    mysql 索引
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" data-path="bplusTree.html">
            
                <a href="bplusTree.html">
            
                    
                    索引结构
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2" data-path="indexValid.html">
            
                <a href="indexValid.html">
            
                    
                    索引失效
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3" data-path="indexRule.html">
            
                <a href="indexRule.html">
            
                    
                    索引规范
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            Published with GitBook
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="." >mysql 多版本控制</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h1 id="mysql&#x591A;&#x7248;&#x672C;&#x63A7;&#x5236;">mysql&#x591A;&#x7248;&#x672C;&#x63A7;&#x5236;</h1>
<h3 id="1-mysql-&#x8868;&#x8BB0;&#x5F55;&#x9ED8;&#x8BA4;&#x90FD;&#x6269;&#x5C55;&#x4E86;&#x4E09;&#x4E2A;&#x9690;&#x85CF;&#x5B57;&#x6BB5;">1. mysql &#x8868;&#x8BB0;&#x5F55;&#x9ED8;&#x8BA4;&#x90FD;&#x6269;&#x5C55;&#x4E86;&#x4E09;&#x4E2A;&#x9690;&#x85CF;&#x5B57;&#x6BB5;</h3>
<table>
<thead>
<tr>
<th>DB_ROW_ID</th>
<th>DB_TRX_ID</th>
<th>DB_ROLL_PTR</th>
</tr>
</thead>
<tbody>
<tr>
<td>&#x5982;&#x679C;&#x8868;&#x6307;&#x5B9A;&#x4E3B;&#x952E;id&#x5C31;&#x548C;&#x4E3B;&#x952E;id&#x76F8;&#x7B49;<br>&#x5982;&#x679C;&#x672A;&#x6307;&#x5B9A;&#x5C31;&#x548C;&#x552F;&#x4E00;&#x7D22;&#x5F15;&#x5BF9;&#x5E94;<br>&#x5982;&#x679C;&#x6CA1;&#x6709;&#x552F;&#x4E00;&#x7D22;&#x5F15;&#xFF0C;&#x5C31;&#x4F1A;&#x9690;&#x5F0F;&#x751F;&#x6210;&#x552F;&#x4E00;&#x7684;DB_ROW_ID<br>6 &#x5B57;&#x8282;DB_TRX_ID&#x5B57;&#x6BB5;&#x6307;&#x793A;&#x63D2;&#x5165;&#x6216;&#x66F4;&#x65B0;&#x884C;&#x7684;&#x6700;&#x540E;&#x4E00;&#x4E2A;&#x4E8B;&#x52A1;&#x7684;&#x4E8B;&#x52A1;&#x6807;&#x8BC6;&#x7B26;&#x3002;<br>&#x5220;&#x9664;&#x5728;&#x5185;&#x90E8;&#x88AB;&#x89C6;&#x4E3A;&#x66F4;&#x65B0;&#xFF0C;&#x5176;&#x4E2D;&#x884C;&#x4E2D;&#x7684;&#x7279;&#x6B8A;&#x4F4D;&#x8BBE;&#x7F6E;&#x4E3A;&#x5C06;&#x5176;&#x6807;&#x8BB0;&#x4E3A;&#x5DF2;&#x5220;&#x9664;</td>
<td>&#x5F53;&#x524D;&#x8BB0;&#x5F55;&#x7684;&#x4E8B;&#x52A1;id<br>&#x5B9E;&#x73B0;&#x591A;&#x7248;&#x672C;&#x63A7;&#x5236;&#x7684;&#x7248;&#x672C;id</td>
<td>&#x6EDA;&#x52A8;&#x6307;&#x9488;: &#x6307;&#x5411;&#x5199;&#x5165;&#x56DE;&#x6EDA;&#x6BB5;&#x7684;&#x64A4;&#x6D88;&#x65E5;&#x5FD7;&#x8BB0;&#x5F55;&#x3002;<br>&#x5982;&#x679C;&#x66F4;&#x65B0;&#x4E86;&#x884C;&#xFF0C;&#x64A4;&#x6D88;&#x65E5;&#x5FD7;&#x8BB0;&#x5F55;&#x5305;&#x542B;&#x5728;&#x66F4;&#x65B0;&#x884C;&#x4E4B;&#x524D;&#x91CD;&#x65B0;&#x751F;&#x6210;&#x884C;&#x5185;&#x5BB9;&#x6240;&#x9700;&#x7684;&#x4FE1;&#x606F;<br>&#x5F53;&#x4E8B;&#x52A1;&#x63D0;&#x4EA4;&#x540E;&#xFF0C;&#x8BE5;&#x5B57;&#x6BB5;&#x5C31;&#x6CA1;&#x6709;&#x610F;&#x4E49;</td>
</tr>
</tbody>
</table>
<h3 id="2-&#x5FEB;&#x7167;&#x8BFB;">2. &#x5FEB;&#x7167;&#x8BFB;</h3>
<p>&#x4EE5;&#x5F53;&#x524D;&#x4E8B;&#x52A1;id&#x4E3A;&#x7248;&#x672C;id,&#x8BFB;&#x5230;&#x7684;&#x7B26;&#x5408;&#x6761;&#x4EF6;&#x7684;&#x6570;&#x636E;</p>
<h3 id="3--&#x5F53;&#x524D;&#x8BFB;">3.  &#x5F53;&#x524D;&#x8BFB;</h3>
<p>&#x4EE5;&#x5F53;&#x524D;&#x6240;&#x6709;&#x5DF2;&#x63D0;&#x4EA4;&#x4E8B;&#x52A1;id&#x4E3A;&#x7248;&#x672C;id&#xFF0C;&#x8BFB;&#x5230;&#x7684;&#x7B26;&#x5408;&#x6761;&#x4EF6;&#x7684;&#x6570;&#x636E;</p>
<h3 id="4--&#x6700;&#x65B0;&#x8BFB;">4.  &#x6700;&#x65B0;&#x8BFB;</h3>
<p>&#x8BFB;&#x5F53;&#x524D;&#x6240;&#x6709;&#x4E8B;&#x52A1;&#x7684;&#x6700;&#x65B0;&#x7684;id</p>
<h3 id="5-&#x5982;&#x4F55;&#x67E5;&#x770B;&#x5F53;&#x524D;&#x8868;&#x8BB0;&#x5F55;&#x7684;rowid">5. &#x5982;&#x4F55;&#x67E5;&#x770B;&#x5F53;&#x524D;&#x8868;&#x8BB0;&#x5F55;&#x7684;row_id</h3>
<pre><code class="lang-mysql">select _rowid   from table limit 5
</code></pre>
<h3 id="6-&#x67E5;&#x770B;&#x5F53;&#x524D;&#x4E8B;&#x52A1;id">6. &#x67E5;&#x770B;&#x5F53;&#x524D;&#x4E8B;&#x52A1;id</h3>
<pre><code class="lang-mysql">-- &#x67E5;&#x8BE2;&#x4E8B;&#x52A1;&#x4FE1;&#x606F;
SELECT TRX_ID FROM INFORMATION_SCHEMA.INNODB_TRX
</code></pre>
<pre><code class="lang-mysql">-- &#x67E5;&#x8BE2;&#x5F53;&#x524D;sessionid
select CONNECTION_ID() from dual;
</code></pre>
<pre><code class="lang-mysql">-- &#x67E5;&#x8BE2;&#x5F53;&#x524D;&#x4E8B;&#x52A1;id
SELECT TRX_ID FROM INFORMATION_SCHEMA.INNODB_TRX  WHERE TRX_MYSQL_THREAD_ID = CONNECTION_ID();
</code></pre>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="level.html" class="navigation navigation-prev " aria-label="Previous page: mysql 事务级别">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="mysqlIndex.html" class="navigation navigation-next " aria-label="Next page: mysql 索引">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"mysql 多版本控制","level":"1.2.2","depth":2,"next":{"title":"mysql 索引","level":"1.3","depth":1,"path":"mysqlIndex.md","ref":"mysqlIndex.md","articles":[{"title":"索引结构","level":"1.3.1","depth":2,"path":"bplusTree.md","ref":"bplusTree.md","articles":[]},{"title":"索引失效","level":"1.3.2","depth":2,"path":"indexValid.md","ref":"indexValid.md","articles":[]},{"title":"索引规范","level":"1.3.3","depth":2,"path":"indexRule.md","ref":"indexRule.md","articles":[]}]},"previous":{"title":"mysql 事务级别","level":"1.2.1","depth":2,"path":"level.md","ref":"level.md","articles":[]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":[],"pluginsConfig":{"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"mvvc.md","mtime":"2020-12-19T04:45:08.662Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2020-12-20T03:10:47.989Z"},"basePath":".","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="gitbook/gitbook.js"></script>
    <script src="gitbook/theme.js"></script>
    
        
        <script src="gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

